// the slide up automatically
const ARROW_DRAG_TRESHOLD = 0.1;
+// The distance in px that the lock screen will move to when pressing
+// a key that has no effect in the lock screen (bumping it)
+const BUMP_SIZE = 25;
+const BUMP_TIME = 0.3;
+
const SUMMARY_ICON_SIZE = 48;
// Lightbox fading times
return true;
}
- return false;
+ // If the dialog is created, but hasn't received focus yet,
+ // the lock screen could be still focused, so bumping would
+ // make the curtain fall again.
+ if (!this._dialog)
+ this._bumpLockScreen();
+ return true;
},
_drawArrow: function() {
this._hideLockScreen(false);
},
+ _bumpLockScreen: function() {
+ Tweener.removeTweens(this._lockScreenGroup);
+ Tweener.addTween(this._lockScreenGroup,
+ { y: -BUMP_SIZE,
+ time: BUMP_TIME / 2,
+ transition: 'easeOutQuad',
+ onComplete: function() {
+ Tweener.addTween(this,
+ { y: 0,
+ time: BUMP_TIME / 2,
+ transition: 'easeInQuad' });
+ }
+ });
+ },
+
_hideLockScreen: function(animate) {
if (animate) {
// Tween the lock screen out of screen